Working with Reports

Description

Reports, Letters, and Labels are Alpha Anywhere layouts for data output. Learn how to create reports in this guide.

Reports are a versatile type of layout for printing data. In reports, you can group related records together, perform calculations, order and select the records that appear, divide pages into columns, and design reports with page headers and footers, graphics, and more. Alpha Anywhere presents a quick and easy way to get started with creating Reports.

Using the Quick Report Genie

The Quick Report Genie guides you through the process of creating a Report. You use the Genie selection dialog boxes to designate the table or set on which to base the report, the records to include in the report, the record order, and the display format of the report. The New Object Genie generates a Report layout based on your input, ready for printing or additional customizing. For example, you decided to develop a phone campaign directed toward your current customers to solicit additional business. The data you need is a list of all your customers and their phone numbers. In the next exercise, you use the Quick Report Genie to produce a customer list. To create a report:

  1. Open the AlphaMovies database

    You should have already created the AlphaMovies database in the Creating a Database lesson.
  2. In the Control Panel, display the Reports tab, and click New. The New Report dialog appears.

    • images/UG_New_Report_dialog.gif
    • In the resulting dialog box, you select the table or set that provides the source of data for the report. You can only select one data source for the report.

  3. Select the "Customers" table.

  4. Select Use Quick Report and click OK.

    • The Quick Report Genie appears.

      images/QuickReportGenie1.gif
    • In the next steps, you specify the title, the style, and the fields that contain the data for the report.

  5. In the Title field, type "Customer List". The following table describes the report Styles.

    • Tabular

      Lists data in a table; fields comprise the columns, and records comprise the rows.

    • Repeating Form

      Presents the data vertically, with each field below the previous field, and a gap between each record.

    • Groups with Totals

      Divides data into logical collections of records, called groups. Calculations can be made on each group. For example, you can group movies on a category field (Horror, Romance, Action) and display the total sales for each category.

    • Summary Report

      Displays a condensed view of the data in a table or set. Summary reports are like Groups With Totals reports, except that individual record data is not listed. Instead, you see only the results of Summary calculations. For example, you would see only the invoice totals and not the cost for each invoice line item.

  6. In the Style drop-down list box, keep the default selection, "Tabular". You add fields from the Table field area by double-clicking the field name, or by dragging the field to the Fields list.

  7. Double-click the following fields: "Customer_ID", "First_Name", "Last_Name", and "Phone_Number".

    images/QuickReportGenie2.gif
  8. After specifying the fields for the report, click the Order button to set the sort order.

  9. Double-click the "Customer_ID" field. "Customer_ID" appears in the Sort Fields column.

    images/QuickReportGenie3.gif
  10. Click the Options button.

  11. In the last step, you select some report appearance options. Select Bold in the Titles frame, and Center title in the Page frame.

    images/QuickReportGenie4.gif
  12. Click OK to generate the report layout. The Quick Report Genie opens the Report Editor displaying your report layout.

    • images/reportEditor1.gif
    • At this point, you can edit the layout, add design elements, such as frames and borders, or preview and print the report without modifications.

  13. To preview the report, select File > Print Preview, or click Print Preview. The report preview appears, as does the Print Preview toolbar.

    images/Preview_Form_button.gif
    images/reportPreview.gif
  14. Select Exit Preview. The Report Editor appears.

  15. Click the Save button on the toolbar. The Save Report As dialog box appears.

  16. Enter the name, "Customer List", and click OK.

In the next sections, you learn more about reports and explore the Report Editor.

Understanding Report Structure

Alpha Anywhere divides reports into the following three Section Types: Report, Detail, and Group.

  • Report

    Prints at the beginning and end of the report. The Report section is a wrapper for the rest of the report.

  • Detail

    Prints individual records, and repeats until all the records have been printed.

  • Groups

    Groups are records that have the same key. Group sections repeat at the beginning and end of each group of records. If you do not specify a Group, the Detail section prints as one continuous section.

Within each of these Section Types, you can have multiple layout regions. A layout region is where you place fields and text, and other objects. Report sections and layout regions print at different times. For example, the Report Header layout region prints once at the beginning of the report and the Report Footer layout region prints once at the end of the report. Group sections print once at the beginning of each group and once at the end of each group. For example, you might group movie titles by category (Horror, Drama, and so on). The Group Header prints at the beginning of the category group and the Group Footer prints at the end of the category group. Each record (movie title) in the group, prints in the Detail layout region, located between the Group Header and Group Footer. Each group, with its associated Detail region, prints repeatedly until all the groups of records are printed. as such, you would have a complete listing of Horror film titles, Drama film titles, and so on.

Exploring the Report Editor

The Report Editor creates a blank report that appears with some of the following report sections.

images/Report_Sections.gif

The Report Editor shows the division between sections and layout regions with section title bars. On each title bar there is a Show/Hide button which lets you toggle the appearance of the section. The Show/Hide buttons only control the report display in the Report Editor ; they do not effect the report appearance when you print or preview it. You can also show and hide report components by selecting Sections, Titles, or Regions from the View menu.

Report Layout Regions

The following table describes some report layout regions. A spillover page occurs when the detail section of a group begins on one page and ends on another.

  • Report Header

    All objects placed in this section appear once at the beginning of the report. Typically, you place the report title, corporate logo, and background information here.

  • Page Header

    All objects placed in this section appear once at the top of every page of the report.

  • Group Header

    All objects placed in this section appear once at the beginning of each data group of the report but not at the top of the spillover pages. When you group in a report, you can place the field on which the report is grouped in this section.

  • Detail Header

    All objects placed in this section appear once at the beginning of the detail region. Field column headings are commonly placed in this section.

  • Detail

    All objects placed in this section appear once at the bottom of the Detail region.

  • Detail Footer

    All objects placed in this section appear once at the bottom of the Detail region.

  • Group Footer

    All objects placed in this section appear once at the end of data group of the report but not at the bottom of the spillover pages. When you group in a report, you can place summary calculations that are performed for each group in this section.

  • Page Footer

    All objects placed in this section appear once at the bottom of every page of the report.

  • Report Footer

    All objects placed in this section appear once at the end of the report. Grand total information for all records is commonly placed in this section.

Other layout regions include:

  • Continuation Headers and Footers

  • Repeating Group Headers and Footers

  • Special Page Headers and Footers

Print Preview Toolbar

On the Report Editor toolbar, click the Print Preview button to preview your Report. You can navigate in the Preview window, using the Print Preview toolbar.

images/Print_Preview_Toolbar_Commented.gif

Printing a Report

Select File > Print, or click the Print button on the toolbar to display the Print dialog box. Use the Print dialog box to specify a printer, range of pages, and number of copies to print.

Converting the Report to PDF

You can convert your report to an Adobe Acrobat Portable Document Format (PDF) file to distribute to others. Anyone who has the Acrobat Reader, which is free and widely distributed, can read the PDF file. To print a report to a PDF file:

  1. With the Customer List Report in the Report Editor, click the Print Preview button. The report appears in the Print Preview window.

  2. Click the Save in Acrobat PDF Format button on the toolbar. Alpha Anywhere converts the Report to PDF format, and displays the report in the Adobe Acrobat Reader.

    • Alpha Anywhere assigns the new PDF file the same name as the report, with a PDF extension.

    images/reportPDF.gif
  3. Click the Email Report as a Acrobat PDF Attachment button on the toolbar. Alpha Anywhere opens your email program, and attaches the report PDF file to a new email message.

  4. Click Exit Preview. The Customer List Report appears in the Control Panel.

In the next section, you create a new report starting with a blank report.

Creating a New Report

In the following procedures, you create the Invoice Items Report, starting with a blank report. To create a report:

  1. In the AlphaMovies Control Panel, display the Reports tab, and click New. The New Report Genie appears.

  2. Select the "Items" table as the data source, and click Next.

  3. Select Start from a blank Report and click Finish. A new, blank report appears in the Report Editor with three empty sections.

    • images/blankReport.gif
    • You use the Drag-and-Drop List to insert field objects in the report layout areas.

  4. Click the Drag-and-Drop List button on the toolbar.

    • images/Drag_and_Drop_List_button.gif
    • When you select a field to insert and drag it to the report section, an object frame appears.

      images/Object_Frame_commented.gif
    • In addition, when you release the mouse button, the Summary Field Genie appears. The Drag-and-Drop List window contains a Genie button that is on by default.

    • images/Genie_button.gif
    • When the Genie button is on, a Summary Field Genie appears that lets you perform a summary calculation for a single field which you are adding to the layout. If you do not want the Summary Field Genie to appear, click button in the Drag-and-Drop List to turn it off.

    • images/Genie_button.gif
    • When adding multiple fields, the Summary Genie does not appear. Also, when adding multiple fields, you can specify their alignment as vertical or horizontal by clicking the appropriate layout button in the Drag-and-Drop List window. After you have placed fields on the report, you can change the style, appearance, and other attributes of the fields.

  5. Click the Horizontal alignment button in the Drag-and-Drop List window.

    images/horizontalAlign.gif
  6. Hold the Shift key, select the following Items fields: "Tape_ID", "Quantity", and "Sale_Price", and drag them into the Detail layout area of the report. The fields appear in the Report.

    • images/detailLayout1.gif
    • You can resize report sections, by placing your cursor over a horizontal layout boundary. When the cursor becomes a two-headed arrow, click and drag to adjust the section height. In the next step, you add a calculated field for the product of the quantity times the sales price.

  7. In the Drag-and-Drop List, under Calculated Fields, select "New Calc/Summary Field", and drag it into the report, next to the Sale_Price field. The New Calculated Field dialog box appears.

    images/calcFieldNew.gif
  8. Enter the Name, Extension, and click the Expression Builder button. The Expression Builder dialog box appears.

  9. Create the expression: Quantity*Sale_Price, and click OK. Alpha Anywhere displays the expression in the New Calculated Field dialog box.

    images/calcField2.gif
  10. Click OK. Alpha Anywhere adds the Extension field to the report, next to the Sale_Price field. You can align selected objects in one layout region by using the Arrange menu and toolbar, like you did when working with forms. In addition, you can use the horizontal and vertical rulers, to move and align selected objects across several layout regions. For small movements of selected objects, you can use the Shift+Arrow keys, and for slightly larger movements, use the Arrow keys.

  11. Click the 'save' button on the toolbar, and save the report as "Invoice Items".

In the next section, you insert additional sections in the report, and add objects.

Creating Report Sections

In the next procedure, you add sections to the Invoice Items report. To add a report section:

  1. With the nvoice Items report in the Report Editor, right-click on the Report section and select Properties, or select Report > Properties > Report Properties from the menu bar. The Report Properties dialog box appears.

  2. Display the Head/Foot tab.

  3. Select Has Page Header, Has Page Footer, and click OK. The new sections appear in the report. You might have to enlarge the Report Editor window to see them.

Working With System Fields

Alpha Anywhere provides predefined system fields that you can add to your report. These system fields can display information such as Page numbers, current date, and sort order. The following table describes Alpha Anywhere system fields.

  • Date

    Prints the computer's system date on the report. This predefined calculated field uses the DATE() function as its expression.

  • PageNumber

    Prints the current page number of the report. This predefined calculated field uses the PAGENO() function as its expression.

  • PageXofY

    Prints the page number and the total number of pages in the report. For example, a field value of "Page 1 of 8" indicates the first page in a eight page report.

  • Current_Order

    Prints the sort order expression for the report.

  • Current_Filter

    Prints the report record selection expression on the report.

You use the Drag-and-Drop List to insert system fields in a report. To insert a system field in the report:

  1. Open the Invoice Items report in the Report Editor.

  2. Select "Date" under System fields in the Drag-and-Drop List, and drag it onto the report, into the Page Header section.

  3. Select "PageXofY" under System fields in the Drag-and-Drop List, and drag it onto the Report, into the Page Footer section. The system fields appear in the report.

    • images/reportSysDate.gif
    • The current system date, and the current page and total number of pages, appear when you preview or print the report.

  4. Click the save button on the toolbar to save the layout, and click the view button to view the report.

    images/Save_button.gif
    images/Preview_Form_button.gif
  5. Click Exit Preview to return to the Report Editor. Next you add text objects and format some field objects.

Adding and Formatting Report Objects

In the following procedures, you create a title heading for your report, some column headings, and you format some fields. You have many options for adding objects and enhancing the Report appearance. In the next sections, you add and format some objects. To add objects to the report:

  1. With the Invoice Items Report in the Report Editor, click the Toolbox button in the toolbar.

    • images/Toolbox_button.gif
    • The Report Toolbox appears. The following image shows the Report Toolbox.

      images/GS_Report_Toolbox.gif
  2. From the Report Toolbox, select the Text tool, and create a rectangle in the Page Header for Report section.

  3. Enter the text "Invoice Items Report".

  4. Right-click in the text field, and select Properties. The Text Properties dialog box appears.

    You can access object properties by selecting the object, and pressing the F12 key.
  5. Display the Alignment tab, and under Horizontal Alignment, click Center.

  6. Click the Font tab, and select Arial, 14, and Bold.

  7. Click OK. The report appears with the title text you specified.

    images/reportTitle.gif
  8. Click Save and preview the Report.

  9. Click Exit Preview to return to the Report Editor. In the next section, you group your report into sections according to Invoice Number.

Inserting a Group

You can divide data into subsets by creating a group. The formation of groups is based on a group break expression. A group break expression can consist of a single field, or a calculated expression composed of a combination of fields, functions, and operators. You use the New Group Properties dialog box to specify the grouping for a Report. To create a group for the report:

  1. With the Invoice Items Report in the Report Editor, select Report > Insert Group Break. The New Group Properties dialog box appears.

  2. Click the Group tab, select "Invoice_Number" in the Break on change in: drop-down list box, and enter "Invoice Number" in the Label text box.

    images/groupProps.gif
  3. Click the Region tab.

  4. Select Keep Group Together on Page, and click OK. Alpha Anywhere adds Group Header and Group Footer sections to the report.

  5. Select "Invoice_Number" in the Drag-and-Drop List, and place it in the Group Invoice Number Header section of the report.

  6. Using the Properties dialog box, format the field as Arial, 12, Bold, and Italic.

  7. Using the Toolbox, place a Text object next to the Invoice Number field object.

  8. Enter the text "Invoice Number", and apply the format Arial, 12, Bold, and Italic, with Center Horizontal Alignment.

    images/groupProps233.gif
  9. Enlarge the Group Invoice Number Header section. In the next steps, you use the Text tool to create a text object in the Group Invoice Number Header section for each field object in the Detail section.

  10. Using the Text tool, create the following text objects and place them in the Group Invoice Number Header section, aligned above the corresponding field object: Tape ID#, Quantity, Cost, Extension.

  11. In the Properties dialog box for each text object, specify Center Horizontal Alignment, and the font, Arial, 10, and Bold.

    images/reportText.gif
  12. Right-click on the Sale_Price field object and select Properties. The Field Properties dialog box appears.

  13. Click the Format tab, and select the "$123,456.78" format Format Style and click OK.

    images/fieldProps.gif
  14. Repeat steps 12, and 13 for the Extension field object.

  15. Click Save and preview the report. The Invoice Items Report appears grouped by invoice number.

    images/reportGroups.gif
  16. Click Exit Preview to return to the Report Editor.

You can use several groupings, but you must take into consideration the nesting order. For example, you might group invoice line items by media type (tape, DVD) and invoice number. If you grouped by invoice number first and then by media type, you would get a list of DVD's for each invoice number and a separate list of tapes for each invoice number. If you grouped by media type first, you would get the line items grouped for the DVD's rented, and then a list of tapes rented for each invoice number.

Suppressing Blank Space in a Report

Alpha Anywhere lets you suppress blank space at the end of each report section, within Report sections, and within objects. To suppress blank space:

  1. Right-click in the white space in a layout region, such as in the Detail section, and select Properties from the right-click menu. The Region Properties dialog box appears.

  2. On the Region tab check Shrink contents of band and click OK.

    • images/detailProps.gif
    • To have Alpha Anywhere suppress blank space within a report band, you must also check the Allow Shrinking property for the objects in the Report section.

  3. Right-click on the Sale_Price field, and select Properties.

  4. On the Setup tab in the Field Properties dialog box, check Allow Shrinking.

    images/fieldProps2.gif

Alpha Anywhere can also suppress blank space at the end of individual objects you place on a report. For a multi-line memo field object on a report, you would make the object size big enough to print the maximum memo size. However, for records that contain less text, you might like to shrink the size of the object. To shrink the size of the object, right-click on the object, select Properties, display the Setup tab, and select Allow Shrinking.

Creating a Summary Calculation

You can provide summary information for your report by creating a calculated field that summarizes groups. In the following procedure, you create summary fields for the total number of tapes and total sales amount for each invoice. To create a summary field:

  1. With the Invoice Items report in the Report Editor, click the Drag-and-Drop List button. The Drag-and-Drop List appears, with the Genie button on (depressed).

    images/Drag_and_Drop_List_button.gif
  2. From the Drag-and-Drop List, select the "Quantity" field, and drag in into the Group Invoice Number Footer section. When you release the mouse button, the Summary Field Genie appears.

    • images/summaryFieldGenie.gif
    • The Summary Field Genie lets you specify whether you want to print the value of the field itself, or some calculated value, such as the total, or count of that field.

  3. Select Total of the Field, and click the Advanced button. The Summarization Advanced Settings dialog box appears.

    • images/summaryFieldGenieAdv.gif
    • You can determine the records to include in the Summary Operation by setting the Group and Subgroup parameters. Optionally, you can modify the calculated field name and display characteristics that Alpha Anywhere assigns.

  4. Keep the Group and Subgroup default settings.

  5. Change the Calculated Field Name to "total_no_tapes", and click OK.

  6. In the Summary Field Genie, click Finish. The total_no_tapes field appears in the Group Invoice Number Footer section of the report.

  7. Select the "Extension" field in the Drag-and-Drop List and drag it into the Group Invoice Number Footer section. The Summary Field Genie appears.

  8. Select Total of the Field, and click Finish. The total calculated field appears in Group Invoice Number Footer section.

  9. With the tot_calc_extension_for_invoice field selected, press the F12 key to display the Field Properties dialog box.

  10. Display the Format tab, select the "$123,456.78" Format Style, and click OK.

  11. Create two text labels: "Total Number of Tapes" and "Total Invoice Sales", and place them next to the corresponding field objects.

    images/reportCalcFields.gif
  12. Using the Properties dialog box, format the text fields as Arial, 10, and Bold.

  13. Click Save and Print Preview. The report appears displaying the total number of tapes and total sales for each Invoice.

    images/reportSummary2.gif

Summary

Reports are a versatile Alpha Anywhere layout for printing data. In this document, you learned that you can use Reports in the following ways:

  • Use the Quick Report Genie to create a Report design for you, then edit the layout it creates, or use it as is.

  • Add, remove, and edit the sections of a Report.

  • Group related records together, useful for dividing data into logical segments.

  • Order and select the records that appear in the Report.

  • Insert summary calculations to display totals, averages, and other values.

  • Set page formatting to prevent sections from being split across a page.

  • Create page headers and footers, and continuation headers and footers.

  • Insert page numbers, today's date, and other Report related information.

  • Publish reports as PDF files, for emailing and reading with the Adobe Reader.

You used the Drag-and-Drop List and Toolbox, to add fields and objects, including calculated and system fields. You used the Properties dialog box to align, format, and arrange fields and other objects, and to add Report sections. See Letters, Labels, and Envelopes to learn about Letters and Labels, two additional Alpha Anywhere layouts for data output.

See Also